import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class App extends Applet{
	boolean c,r,l;
	public void init(){
		Panel p=new Panel();
		Button rect=new Button("Rectangle");
		Button cir=new Button("Circle");
		Button lin=new Button("Line");
		
		c=r=l=false;
		
		p.add(rect);
		p.add(cir);
		p.add(lin);
		
		rect.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent evt){
					r=true;				
					repaint();
			}
		});
		
		cir.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent evt){
					c=true;
					repaint();
			}
		});
		
		lin.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent evt){
					l=true;
					repaint();
			}
		});
		
		add(p);
	}
		
	public void paint(Graphics g){
		if(c==true){
			g.drawOval(125,150,250,250);
		}
		if(l==true){
			g.drawLine(125,150,350,350);
		}
		if(r==true){
			g.drawRect(125,150,250,250);
		}
	
		c=l=r=false;
	}
	
}
